import re;
exp="This password is used by project members when checking out or committing source code changes"
matchObj = re.match( r'password', exp, re.M|re.I)
searchobject=re.search(r'password',exp,re.M|re.I);
#match checks for a match only at the beginning of the string,
#while search checks for a match anywhere in the string (this is what Perl does by default).
if matchObj:
	print matchObj.group();
if searchobject:
	print searchobject.group();
modified_exp=re.sub(r'password','pwd',exp,2)
print modified_exp